@model HDLogCenter.Infrastructure.Models.AppConfigModel
@{
    ViewData["Title"] = "编辑项目";
}

<div class="layui-card">
    <div class="layui-card-header">
        <h2>编辑项目</h2>
    </div>
    <div class="layui-card-body">
        <form class="layui-form layui-form-pane" asp-action="Edit" method="post">
            <input type="hidden" asp-for="Id" />
            
            <div class="layui-form-item">
                <label class="layui-form-label">项目名称</label>
                <div class="layui-input-block">
                    <input type="text" asp-for="AppName" placeholder="请输入项目名称" class="layui-input" required>
                    <span asp-validation-for="AppName" class="text-danger"></span>
                </div>
            </div>
            
            <div class="layui-form-item">
                <label class="layui-form-label">项目编码</label>
                <div class="layui-input-block">
                    <input type="text" asp-for="AppCode" placeholder="请输入项目编码" class="layui-input" required>
                    <span asp-validation-for="AppCode" class="text-danger"></span>
                </div>
            </div>
            
            <div class="layui-form-item">
                <label class="layui-form-label">描述</label>
                <div class="layui-input-block">
                    <textarea asp-for="Description" placeholder="请输入项目描述" class="layui-textarea"></textarea>
                </div>
            </div>
            
            <div class="layui-form-item">
                <label class="layui-form-label">通知Webhook</label>
                <div class="layui-input-block">
                    <input type="url" asp-for="NotifyWebhook" placeholder="请输入钉钉Webhook地址" class="layui-input">
                </div>
            </div>
            
            <div class="layui-form-item">
                <label class="layui-form-label">通知手机号</label>
                <div class="layui-input-block">
                    <input type="text" asp-for="NotifyPhone" placeholder="请输入通知手机号" class="layui-input">
                </div>
            </div>
            
            <div class="layui-form-item">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-block">
                    <input type="radio" name="Status" value="1" title="启用" @(Model.Status == 1 ? "checked" : "")>
                    <input type="radio" name="Status" value="0" title="禁用" @(Model.Status == 0 ? "checked" : "")>
                </div>
            </div>
            
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="submit" class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    <a href="/Project" class="layui-btn layui-btn-warm">返回列表</a>
                </div>
            </div>
        </form>
    </div>
</div>

@section Scripts {
    <script>
        layui.use(['form'], function(){
            var form = layui.form;
            
            // 监听提交
            form.on('submit(formDemo)', function(data){
                // 这里可以添加提交前的验证逻辑
                return true;
            });
        });
    </script>
}